package com.me.service;

import com.me.Utils.DIContainer;

public class Services {
	private static DIContainer container = new DIContainer();

	public static void addScope(Class type, Class entity) {
		container.bind(type, entity);
	}

	public static void addSingle(Class type) {
		Object o = container.resolve(type);
		addSingle(o);
	}

	public static void addSingle(Object object) {
		try {
			addSingle(Class.forName(object.getClass().getTypeName()),object);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}

	public static void addSingle(Class type,Object object) {
		container.bind(type,object);
	}


	public static Object resolve(Class entity) {
		return container.resolve(entity);
	}

	public static void inject(Object o) {
		container.inject(o);
	}
}
